home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / p063b9s.zip / UNIT / POPSTATU.PAS < prev    next >
Pascal/Delphi Source File  |  1996-06-26  |  2KB  |  54 lines

  1. UNIT PopStatu;
  2. {╔══════════════════════════════════════════════════════════════════════════╗}
  3. {║ Shows status of other Portal's on network     Last changed: 26.06.96  SA ║}
  4. {║                                                                          ║}
  5. {║                         (C) Copyright 1989-96 by                         ║}
  6. {║       Dan Wulff, Jens Sandalgaard, Steen Christensen & S¢ren Ager        ║}
  7. {║                                                                          ║}
  8. {║ This source may not be given to anybody, without the written permission  ║}
  9. {║ from The Portal Team.                                                    ║}
  10. {╚══════════════════════════════════════════════════════════════════════════╝}
  11. {$I POPDEFS.INC}
  12.  
  13. INTERFACE
  14.  
  15. USES Use32;
  16.  
  17. PROCEDURE PortalStatus;
  18.  
  19. IMPLEMENTATION
  20.  
  21. USES OpCrt, OpWindow, OpString, OpKey, ApTimer,
  22.      PoPTypes, Globals, Util, MTask, KeyBoard, InterCom, OproUtil, Com,
  23.      StrUtil;
  24.  
  25.   PROCEDURE PortalStatus;
  26.   VAR
  27.     StatWin : WindowPtr;
  28.     i : Byte;
  29.     ICR: TInterCom;
  30.     Ch : Char;
  31.     t : EventTimer;
  32.   BEGIN
  33.     MyWin(StatWin,1,2,80,ScreenHeight,2,'Portal multiline status',false);
  34.     REPEAT
  35.       ClrScr;
  36.       WriteLn(' Task  Address           Status');
  37.       FOR i:=0 TO GetMaxLines DO
  38.       BEGIN
  39.         IF GetInterCom(i,ICR) And (ICR.Status<>ICUnused) And (ICR.MyAddress.Zone<>0) THEN
  40.         BEGIN
  41.           IF i=Cfg.TaskNumber THEN Ch:='*' ELSE Ch:=' ';
  42.           WITH ICR DO
  43.             WriteLn(ch,i:4,'  ',Pad(Address2Str(MyAddress),16),'  ',ICStatusStr(ICR));
  44.         END;
  45.       END;
  46.       NewTimerSecs(t, 6);
  47.       WHILE Not TimerExpired(t) and Not PopKeyPressed And Not ComPort^.KeyPressed DO
  48.         GiveUpTime;
  49.     UNTIL PopKeyPressed OR ComPort^.KeyPressed;
  50.     KillWindow(StatWin);
  51.   END;
  52.  
  53. END.
  54.